<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../lib/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>用户管理</title>
</head>
<body>
    <div class="pt-5  pl-20 pr-20 pb-20">
        <form id="itemEdit" name="itemEdit" method="post" action="../ashx/spui.ashx" class="form form-horizontal">
            <input type="hidden" class="actionValue" id="editAction" name="action" value="add" />
            <input type="hidden" id="id" name="id" />
            <input type="hidden" id="actionaddlistids" name="actionaddlistids" value="ftaskid,finfoid,finfofv1,finfonv1" /><!--当为批量操作时（批量插入时）这几个数据为,分隔处理，作业批量的依据-->
            <input type="hidden" id="tablename" name="tablename" value="" />
            <input type="hidden" id="tablemidname" name="tablemidname" value="" />
            <input type="hidden" id="dataneedtouser" name="dataneedtouser" value="1" /><!--是否要包含通用数据必归属处理-->
            <input type="hidden" id="finfoid" name="finfoid" value="地ID" />
            <!-- <input type="hidden" id="finfofv1" name="finfofv1" value="地NO" />-->
            <!--<input type="hidden" id="finfonv1" name="finfonv1" value="地MJ" />-->
            <input type="hidden" id="finfotypename" name="finfotypename" value="清园" />
            <input type="hidden" id="ftaskid" name="ftaskid" value="" />
            <input type="hidden" id="finfotype" name="finfotype" value="2" />
            <input type="hidden" id="finfobytype1" name="finfobytype1" value="2" />
            <div id="tab-category" class="HuiTab">
                <div class="tabBar cl" id="tab-categorybar">
                    <span>
                        <label id="lb_worktypeshow">作业基本信息</label></span><span>作业图片信息</span><span>作业用料信息</span>
                </div>
                <div class="tabCon" id="divtab1">
                    <div id="divshow1">
                        <div class="row cl">
                            <label class="form-label col-2">地块编号：</label>
                            <div class="formControls col-2">
                                <input type="text" class="input-text" name="finfofv1" id="finfofv1" readonly="true" style="background-color: #cccccc;" />
                            </div>
                            <div class="col-1"></div>
                            <label class="form-label col-2">本次作业面积：</label>
                            <div class="formControls col-2">
                                <input type="text" class="input-text" name="finfonv1" id="finfonv1" placeholder="作业面积" value="0" />
                            </div>
                            <div class="col-1"></div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-2">作业开始时间：</label>
                            <div class="formControls col-2">
                                <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd  HH:mm:ss'})" name="finfodt1" id="finfodt1" class="input-text Wdate" />
                            </div>
                            <div class="col-1"></div>
                            <label class="form-label col-2">作业结束时间：</label>
                            <div class="formControls col-2">
                                <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd  HH:mm:ss'})" name="finfodt2" id="finfodt2" class="input-text Wdate" />
                            </div>
                            <div class="col-1"></div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-2">作业人员：</label>
                            <div class="formControls col-2">
                                <input type="text" class="input-text" name="finfofv3" id="finfofv3" readonly="readonly" placeholder="右边选择或搜索选择" />
                                <input type="hidden" id="finfofv2" name="finfofv2" />
                            </div>
                            <div class="col-3 layui-form">
                                <select name="inoutusernamesel" id='inoutusernamesel' lay-filter="testselect" lay-verify="required" lay-search="">
                                    <option value="">直接选择或搜索选择</option>
                                </select>
                            </div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-2">天气状况：</label>
                            <div class="formControls  skin-minimal col-7">
                                <div class="radio-box">
                                    <input type="radio" id="finfofv4" name="finfofv4" value="晴天" class="hcradio" checked="checked" />
                                    <label for="finfofv4">晴天</label>
                                </div>
                                <div class="radio-box">
                                    <input type="radio" id="finfofv42" name="finfofv4" value="阴天" />
                                    <label for="finfofv42">阴天</label>
                                </div>
                                <div class="radio-box">
                                    <input type="radio" id="finfofv43" name="finfofv4" value="雨天" />
                                    <label for="finfofv43">雨天</label>
                                </div>
                                <div class="radio-box">
                                    <input type="radio" id="finfofv44" name="finfofv4" value="其它" />
                                    <label for="finfofv44">其它</label>
                                </div>
                            </div>
                            <div class="col-2"></div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-2">作业工具：</label>
                            <div class="col-3 layui-form">
                                <select name="finfofv5" id='finfofv5' lay-filter="testselect2" lay-verify="required" lay-search="">
                                    <option value="">直接选择或搜索选择</option>
                                </select>
                            </div>
                            <label class="form-label col-2">作业说明：</label>
                            <div class="formControls col-3">
                                <input type="text" class="input-text" name="finfofv6" id="finfofv6" />
                            </div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-2">投入品：</label>
                            <div class="col-3 layui-form">
                                <select name="finfofv7" id='finfofv7' lay-filter="testselect4" lay-verify="required" lay-search="">
                                    <option value="">直接选择或搜索选择</option>
                                </select>
                            </div>
                            <label class="form-label col-2">投入量：</label>
                            <div class="formControls col-3">
                                <input type="text" class="input-text" name="finfofv8" id="finfofv8" placeholder="投入量" value="0" />
                            </div>
                            <div class="col-1"></div>
                        </div>
                        <div class="row cl" id="divtrfor8" style="display: none;">
                            <!--植保特殊数据-->
                            <label class="form-label col-2">防治对象：</label>
                            <div class="col-3 layui-form">
                                <select name="finfofv10" id='finfofv10' lay-filter="testselect5" lay-verify="required" lay-search="">
                                    <option value="">直接选择或搜索选择</option>
                                </select>
                            </div>
                        </div>
                        <div class="row cl" id="divtrfor6" style="display: none;">
                            <!--播种特殊数据-->
                            <label class="form-label col-1">播种方式：</label>
                            <div class="formControls col-2">
                                <span class="select-box">
                                    <select class="select" name="finfofv9" id="finfofv9">
                                        <option value="直播">直播</option>
                                        <option value="移植">移植</option>
                                    </select>
                                </span>
                            </div>
                            <label class="form-label col-1">播种量：</label>
                            <div class="formControls col-2">
                                <input type="text" class="input-text" name="finfonv2" id="finfonv2" placeholder="播种量" value="0" datatype="/^-?[1-9]+(\.\d+)?$|^-?0(\.\d+)?$|^-?[1-9]+[0-9]*(\.\d+)?$/" />
                            </div>
                            <div class="col-1"></div>
                        </div>
                        <div class="row cl" id="divtrfor11" style="display: none;">
                            <!--采摘特殊数据-->
                            <label class="form-label col-2">采摘重量：</label>
                            <div class="formControls col-3">
                                <input type="text" class="input-text" name="finfonv3" id="finfonv3" placeholder="采摘重量" value="0" datatype="/^-?[1-9]+(\.\d+)?$|^-?0(\.\d+)?$|^-?[1-9]+[0-9]*(\.\d+)?$/" />
                            </div>
                            <label class="form-label col-2">采摘状态：</label>
                            <div class="formControls col-3">
                                <input type="text" class="input-text" name="finfofv11" id="finfofv11" readonly="true" value="待入库" style="background-color: #cccccc;" />
                            </div>
                        </div>
                        <div class="row cl" id="divtrfor12" style="display: none;">
                            <!--报废特殊数据-->
                            <label class="form-label col-2">报废面积：</label>
                            <div class="formControls col-3">
                                <input type="text" class="input-text" name="finfonv4" id="finfonv4" placeholder="报废面积" value="0" datatype="/^-?[1-9]+(\.\d+)?$|^-?0(\.\d+)?$|^-?[1-9]+[0-9]*(\.\d+)?$/" />
                            </div>
                             <label class="form-label col-2">报废原因：</label>
                            <div class="formControls col-3">
                                <input type="text" class="input-text" name="finfofv12" id="finfofv12" placeholder="报废原因"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tabCon" id="divtab2">
                    <div id="divshow2">
                        <div class="row cl">
                            <input type="hidden" id="finfoimg1" name="finfoimg1" value="" />
                            <div class="col-5">作业图片1<img id="imgExist1" src="../defaultimg/hcrainaddimg.jpg" width="210px" height="250px"></div>
                            <div class="col-1">
                                <button onclick="addhcrainImgAll('finfoimg1','imgExist1');" class="btn btn-default radius" type="button">上传</button>
                            </div>

                            <input type="hidden" id="finfoimg2" name="finfoimg2" value="" />
                            <div class="col-5">作业图片2<img id="imgExist2" src="../defaultimg/hcrainaddimg.jpg" width="210px" height="250px"></div>
                            <div class="col-1">
                                <button onclick="addhcrainImgAll('finfoimg2','imgExist2');" class="btn btn-default radius" type="button">上传</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tabCon" id="divtab3">
                    <div id="divshow3">
                        <div class="row cl">
                        </div>


                    </div>
                </div>
            </div>
            <div class="cl" style="display: none;" id="fold_category">
                <ul id="Huifold2" class="Huifold">
                    <li class="item">
                        <h4>基本设置<b>+</b></h4>
                        <div class="info" id="divfold1" style="display: block;">
                        </div>
                    </li>
                    <li class="item">
                        <h4>基本设置2<b>+</b></h4>
                        <div class="info" id="divfold2" style="display: block;">
                        </div>
                    </li>
                    <li class="item">
                        <h4>基本设置3<b>+</b></h4>
                        <div class="info" id="divfold3" style="display: block;"></div>
                    </li>
                </ul>
            </div>
            <div class="row cl">
                <div class="col-6 col-offset-4">
                    <button onclick="changeshowtype();" class="btn btn-danger radius" type="button">切换显示</button>&nbsp;&nbsp;&nbsp;&nbsp;
                    <button class="btn btn-primary radius" type="submit" id="btsub1">提交</button>&nbsp;&nbsp;
		<!--		<button class="btn btn-secondary radius" type="button" id="btn_reset">重置</button>&nbsp;&nbsp;-->
                    <button onclick="layer_close();" class="btn btn-default radius" type="button">返回</button>
                </div>
            </div>
            <!--   <div class="row cl">
                <div class="col-10" id="divforhcrfbutton">
                   
                </div>
            </div>-->
        </form>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/layui/layui.js"></script>
    <script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="../lib/Validform/5.3.2/Validform.js"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_au.js"></script>
    <script type="text/javascript" src="ywjs/sctaskworklistnew.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>


    <script type="text/javascript">
        var uiform = null;
        HcUiAuloadInfoAuto = false;//将自动加载，设置为false（禁用自动加载）
        var loadisOk = 1;
        var divshowtype = 1;
        //加载处理
        spsetBaseNoBt("hsc_task_info", "id", "hsc_task_info as T", "*", "#tablelist", "hsc_task_info", "作业管理", "hsc_task_info");
        Mhcloadback[0] = "infotypename";
        Mhcloadback[1] = "infoimg1";
        Mhcloadback[2] = "infoimg2";
        Mhcloadback[3] = "infofv5";
        Mhcloadback[4] = "infofv7";
        Mhcloadback[5] = "infofv10";
        //加载处理
        function loadin() {
            if (getUrlParam("action") == "add" || getUrlParam("action") == "addlist") {
                $("#editAction").val(getUrlParam("action"));
                if (getUrlParam("action") == "addlist") $('#finfonv1').attr("readonly", true);
                thisloadinByAdd();//添加作业记录的加载处理
            }
            layui.use(['form'], function () {
                uiform = layui.form();
                uiform.on('select(testselect)', function (data) {
                    $('#finfofv2').val(data.value);
                    $('#finfofv3').val($("#inoutusernamesel").find("option:selected").text());
                });
                //人员下拉加载 
                hcdoselbyPost("empid  as id,concat(depname,'-',empname) as name,empname as username,mobile as  tel,depname as address", "view_user", "branchid='" + HCUser.HCUorg + "'", "", "", "id",
                    function (data) {
                        SetSelectWithArrayIdName("#inoutusernamesel", data);
                        loadisOk--;
                        if (loadisOk <= 0 && auhcotype == "edit") {
                            loadInfoById(aumid, function (data) {
                                loadback(data);
                            });
                        }
                        if (getUrlParam("action") == "add" || getUrlParam("action") == "addlist") {
                            //默认的人员
                            $("#inoutusernamesel").val(HCUser.HCUide);
                            $('#finfofv2').val(HCUser.HCUide);
                            $('#finfofv3').val($("#inoutusernamesel").find("option:selected").text());
                            //加载作业工具及作业投入品,finfofv10
                            loadworkggfv5fv7(false, false, false);
                        }

                        // uiform.render('select');
                    });
            });


            $.Huitab("#tab-category .tabBar span", "#tab-category .tabCon", "current", "click", "0");
            $.Huifold("#Huifold2 .item h4", "#Huifold2 .item .info", "", 3, "click"); /*5个参数顺序不可打乱，分别是：相应区,隐藏显示的内容,速度,类型,事件 mouseover click */

        }
        function loadback(data) {
            $("#lb_worktypeshow").html(data["infotypename"] + "作业");//显示作业
            if (data["infoimg1"]) hcrainloadimg("#imgExist1", data["infoimg1"]);
            if (data["infoimg2"]) hcrainloadimg("#imgExist2", data["infoimg2"]);
            //加载下拉 工具及投入品
            loadworkggfv5fv7(data["infofv5"], data["infofv7"], data["infofv10"]);
            //如果已完成。禁用提效    

            hcdoselbyPost("taskstatus", "hsc_task", "id='" + $("#ftaskid").val() + "'", "", "", "id", function (data) {
                if (data[0].taskstatus == "完成" || data[0].taskstatus == "中止") { $("#btsub1").hide(); }
            });
        }
        //切换事件
        function changeshowtype() {
            if (divshowtype == 1) {
                $("#divshow1").appendTo("#divfold1");
                $("#divshow2").appendTo("#divfold2");
                $("#divshow3").appendTo("#divfold3");
                $("#fold_category").show();
                $("#tab-category").hide();

                divshowtype = 2;
            }
            else {
                $("#divshow1").appendTo("#divtab1");
                $("#divshow2").appendTo("#divtab2");
                $("#divshow3").appendTo("#divtab3");
                $("#fold_category").hide();
                $("#tab-category").show();
                divshowtype = 1;
            }

        }
    </script>
</body>
</html>
